TrackJR: a new R-package using Julia language for tracking tiny insects

Elevator Pitch session

Gerardo de la vega (1,2), Federico Triñanes (1), Andres Gonzalez Ritzel (1)  
1 Laboratorio de Ecología Química, Universidad de la República. Montevideo, Uruguay.
2 Grupo de Ecología de Poblaciones de Insectos, IFAB CONICET-INTA EEA Bariloche. Bariloche, Argentina.

06/July/2021

Why tracking insect behaviour?

/ https://github.com/Gdlv/trackJR

trackJR






/ https://github.com/Gdlv/trackJR

Functions

Tracking

firstJulia() Connect R and Julia and create functions for Julia.
trackJR() Tracks the insect position. Output a dataframe with frame, x and y position.
trackJR_ggplot() Plots as a ggplot element.

Batch proccessing

trackJR_Batch() Generate a list with videos tracked.
trackJR_Batch_ggplot() Add the ggplot to each video elements of the list.

Analize data

trackJR_box() Draw a box in a ggplot.
trackJR_pbox() Extract the points from a box.
trackJR_summ() Extract the mean number of frames in each box.

Helpful tools

trackJR_clean() Select points in conflict to solve the tracked position.
trackJR_correctXY() Correct the X and the Y position of tracked dataframe with a trackJR data as reference.
trackJR_refpoint() Use a point reference to correct a data trackJR.

trackJR

  JuliaCall::julia_command("
begin
    using Statistics
end
")

  JuliaCall::julia_command("
brightness(c) = 0.3 * c.r + 0.59 * c.g + 0.11 * c.b
")









/ https://github.com/Gdlv/trackJR

trackJR

system(paste("ffmpeg -i ",VFile," -r ",rframes," -t ",pathDirTemp,"%d.png",sep=""))














/ https://github.com/Gdlv/trackJR

trackJR

library(shiny)
  library(miniUI)
  ui=miniPage(
    tags$h1("Create a Region of Interest"),

    fluidRow(
    ...
  )

  runGadget(ui, server, viewer = viewer)
  }






/ https://github.com/Gdlv/trackJR

trackJR

dataT<-trackJR(mypathDirandFile)
graf<-trackJR_ggplot(mypathDirandFile,dataT)

library(gganimate)
graf2g<-graf+  transition_components(fr)+
  ease_aes(x = 'sine-out', y = 'sine-out') +
  shadow_wake(1, size = 3, alpha = TRUE, wrap = F,colour = "green",
  falloff = 'sine-in', exclude_phase = NULL)

animate(graf2g, nframes = 100,duration=5,renderer = gifski_renderer("gganim.gif"))





/ https://github.com/Gdlv/trackJR

Thanks!














/ https://github.com/Gdlv/trackJR